<div class="modal fade" id="updataModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
     aria-hidden="true">
    <div class="modal-dialog">
        <form method="post" action="{:url('ClubAdmin/ClubController/update')}" enctype="multipart/form-data">

            <div class="modal-content">
                <div class="modal-header">
                <h4 class="modal-title" id="myModalLabel">更新</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    
                </div>

               <div class="modal-body">

                    <div class="form-group">
                        <label for="name">俱乐部名称</label>
                        <input type="text" class="form-control" name="cname"  id="cname">
                    </div>

                    <div class="form-group">
                        <label for="name">俱乐部简介</label>
                        <input type="text" class="form-control" name="cintro"  id="cintro">
                    </div>

                     
                     <div class="form-group">
                        <label for="name">电话号码</label>
                        <input type="text" class="form-control" name="ctel" id="ctel">
                    </div>
                       <div class="form-group">
                        <label for="name">图片</label>
                      <td><input type="file" name="cpic" >
                      <input type="hidden" name="cpic" value="" id="hidden1" >
                     <img src="" id="cpic" style="width: 80px;" >
                     </td>
                    </div>
                       <div class="form-group">
                        <label for="name">地址</label>
                        <input type="text" class="form-control" name="caddress"  id="caddress">
                    </div>
                       <div class="form-group">
                        <label for="name">开放时间</label>
                        <input type="text" class="form-control" name="copentime" placeholder="开放时间" id="copentime">
                    </div>
                     
                       <div class="form-group">
                        <label for="name">经度</label>
                        <input type="text" class="form-control" name="clatitude"  id="clatitude">
                    </div>
                     
                       <div class="form-group">
                        <label for="name">纬度</label>
                        <input type="text" class="form-control" name="clongitude"  id="clongitude">
                    </div>
                    
                  <input type="hidden" name="cid" value="" id="hidden2" >
                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">确认修改</button>
                </div>

            </div><!-- /.modal-content -->
        </form>
    </div><!-- /.modal -->
</div>
<script type="text/javascript">
        function jsedit(cid)
        {
            //console.log(aid);
           $.ajax({
            url:"{:url('club_controller/edit')}",
            data:{
                "cid":cid
            },
            dataType:'json',
            success(data){
               console.log(data);
          $("#cname").val(data.cname);
console.log(data.cname);
          $("#cintro").val(data.cintro);

          $("#ctel").val(data.ctel);

          $("#copentime").val(data.copentime);

          $("#cpic").attr('src',"__STATIC__/img/clubimg/"+data.cpic); 

          $("#caddress").val(data.caddress);

          $("#clatitude").val(data.clatitude);

          $("#clongitude").val(data.clongitude);

          $("#hidden1").val(data.cpic);

          $("#hidden2").val(data.cid);

          $("#updataModal1").modal.show;

            }
        }); 
        }

    </script>